package com.gklyj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gklyj.pojo.Feedback;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface feedbackMapper extends BaseMapper<Feedback> {

    //获取部门某人的反馈信息
    @Select("select * from feedback where name = #{name} and u_id =#{u_id}")
    List<Feedback> getOneDepartmentFeedback(String name,Integer u_id);

    //根据不同状态获取反馈信息
    @Select("select * from feedback where state =#{state}")
    List<Feedback> getFeedbackByState(String state);

    //根据条件查找反馈信息
    List<Feedback> searchDisserenceFeedback(Feedback feedback);

    //统计新反馈信息的数量
    @Select("select count(*) from feedback where state = '未查看'")
    Integer searchNewFeedback();
}
